package model;

/**
 * ToJailCard is a card that puts the player in jail
 * @author Group 20
 *
 */
public class ToJailCard extends Move
{
	/**
	 * The field number that the card moves the player to
	 */
	private int fieldNumber;

	/**
	 * Constructor
	 * @param description: Card description
	 * @param fieldNumber: field number of jail
	 */
	public ToJailCard(String description, int fieldNumber) {
		super(description);
		this.fieldNumber = fieldNumber;
	}
	
	/**
	 * Executes the card and puts the player in jail.
	 */
	@Override
	public boolean draw(Player player) {
		player.setStandOnField(fieldNumber);
		player.setInJail(true);
		player.setCarryOn(false);
		player.setNumOfDicePairs(0);
		payment = 0;
		return true;
	}

}
